//
//  DeviceSettingVC.swift
//  XSQWiFi
//
//  Created by XinPengLee on 2025/5/8.
//

import UIKit

class DeviceSettingVC: PresentBaseViewController {

    @IBOutlet weak var widthConsRatio: NSLayoutConstraint!
    
    @IBOutlet weak var luminanceAddButton: UIButton!
    @IBOutlet weak var luminanceMinusButton: UIButton!

    let progreeWidth = XSQ_Width - 144
    
    var brightness:CGFloat = 1
    
    private var longPressIncrease: UILongPressGestureRecognizer!
    private var longPressMinus: UILongPressGestureRecognizer!

    override func viewDidLoad() {
        super.viewDidLoad()

        longPressIncrease = UILongPressGestureRecognizer(target: self, action: #selector(longPressIncreaseBrightness))
        luminanceAddButton.addGestureRecognizer(longPressIncrease)
        luminanceAddButton.addGestureRecognizer(longPressMinus)
    }

    @IBAction func luminanceMinusButtonClick(_ sender: Any) {
        brightness -= 0.1
        widthConsRatio.constant = progreeWidth * brightness
        
        
        
    }
    
    @IBAction func luminanceAddButtonClick(_ sender: Any) {
        
        
    }

    @objc private func longPressIncreaseBrightness(_ gesture: UILongPressGestureRecognizer) {
            if gesture.state == .began || gesture.state == .changed {
                
                XPLog(message: "gesture")

            }
        }

        @objc private func longPressDecreaseBrightness(_ gesture: UILongPressGestureRecognizer) {
            if gesture.state == .began || gesture.state == .changed {
                XPLog(message: "gesture")
            }
        }
    
}
